<!DOCTYPE html>
<html lang="zh-CN">





<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/blog/img/apple-touch-icon.png">
  <link rel="icon" type="image/png" href="/blog/img/favicon.png">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  <meta name="description" content="兴趣使然的个人博客">
  <meta name="author" content="Ilirus">
  <meta name="keywords" content>
  <title>Ilirus</title>

  <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/css/bootstrap.min.css">



<!-- 主题依赖的图标库，不要自行修改 -->
<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_yg9cfy8wd6.css">

<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_pjno9b9zyxs.css">

<link rel="stylesheet" href="/blog/css/main.css">

<!-- 自定义样式保持在最底部 -->


  <script src="/blog/js/utils.js"></script>
</head>


<body>
  <header style="height: 100vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/blog/">&nbsp;<strong>Ilirus</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/tags/">
                <i class="iconfont icon-tags-fill"></i>
                标签
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/blog/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="view intro-2" id="background" parallax=true
         style="background: url('/blog/img/default.png') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="container text-center white-text fadeInUp">
            <span class="h2" id="subtitle">
              
            </span>

            
          </div>

          
            <div class="scroll-down-bar">
              <i class="iconfont icon-arrowdown"></i>
            </div>
          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      <div class="container nopadding-md">
        <div class="py-5" id="board"
          style=margin-top:0>
          
          <div class="container">
            <div class="row">
              <div class="col-12 col-md-10 m-auto">
                


  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/04/09/OAuth2-0授权服务器搭建与配置/">OAuth2.0授权服务器搭建与配置</a>

      <a href="/blog/2020/04/09/OAuth2-0授权服务器搭建与配置/" class="index-excerpt">
        
        
          
        
        <div>OAuth2.0授权服务器搭建向pom.xml中添加以下依赖&lt;dependencies&gt;
  &lt;dependency&gt;
    &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
    &lt;artifactId&gt;spring-cloud-starter-security&lt;/artifactId&</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-04-09
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/OAuth/">OAuth</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/OAuth/">OAuth</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/04/07/OAuth2-0简介/">OAuth2.0简介</a>

      <a href="/blog/2020/04/07/OAuth2-0简介/" class="index-excerpt">
        
        
          
        
        <div>什么是OAuth
OAuth(开放授权)是一个开放标准，允许用户让第三方应用访问该用户在某一网站上存储的私密的资源(如照片，视频，联系人列表)，而无需将用户名和密码提供给第三方应用。

举个例子: 用户借助QQ认证去登录网站A，如果认证通过了，就不需要用户手动在网站A注册账户了。
那么怎么样才算认证通过？网站A成功从QQ获取用户信息则认为认证成功了。那么如何从QQ那里获取用户的身份信息呢？用户信息</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-04-07
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/OAuth/">OAuth</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/OAuth/">OAuth</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/04/04/SpringSecurity使用注解进行授权控制/">SpringSecurity使用注解进行授权控制</a>

      <a href="/blog/2020/04/04/SpringSecurity使用注解进行授权控制/" class="index-excerpt">
        
        
          
        
        <div>使用注解进行授权控制
从SpringSecurity2.0版本开始，支持服务层方法的安全性支持，目前有@Secured，@PreAuthorize，@PostAuthorize三类注解

在@Configuration实例上使用@EnableGlobalMethodSecurity注解来启用基于注解的授权控制@Configuration
@EnableWebSecurity
// 启用方法授权
@</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-04-04
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/04/03/SpringSecurity会话管理/">SpringSecurity会话管理</a>

      <a href="/blog/2020/04/03/SpringSecurity会话管理/" class="index-excerpt">
        
        
          
        
        <div>在Controller中获取认证信息@Controller
public class IndexController &#123;
    @RequestMapping("/user")
    public String user(Model model) &#123;
        String username = getUserName();
        model.addAttr</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-04-03
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/03/31/SpringSecurity自定义登录与注销/">SpringSecurity自定义登录与注销</a>

      <a href="/blog/2020/03/31/SpringSecurity自定义登录与注销/" class="index-excerpt">
        
        
          
        
        <div>自定义登录页修改配置@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter &#123;
    @Override
    protected void configure(HttpSecurity http) throws Exception &#123</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-03-31
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/03/29/笔记-SpringCloud学习10-OpenFeign超时配置与日志记录/">[笔记]SpringCloud学习10: OpenFeign超时配置与日志记录</a>

      <a href="/blog/2020/03/29/笔记-SpringCloud学习10-OpenFeign超时配置与日志记录/" class="index-excerpt">
        
        
          
        
        <div>设置超时时间在application.yml中# 设置超时时间
ribbon:
  # 指与服务器建立链接的超时时间(单位: ms)
  ConnectTimeout: 1000
  # 指与服务器建立链接之后，从服务器读取到可用资源所花时间
  ReadTimeout: 5000
配置日志输出OpenFeign有4个日志级别

NONE: 不输出任何日志
BASIC: 仅记录请求方法、URL、响</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-03-29
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/学习笔记/">学习笔记</a>
            
              <a href="/blog/categories/学习笔记/SpringCloud/">SpringCloud</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringCloud/">SpringCloud</a>
            
              <a href="/blog/tags/OpenFeign/">OpenFeign</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/03/29/笔记-SpringCloud学习09-OpenFeign服务调用/">[笔记]SpringCloud学习09: OpenFeign服务调用</a>

      <a href="/blog/2020/03/29/笔记-SpringCloud学习09-OpenFeign服务调用/" class="index-excerpt">
        
        
          
        
        <div>Feign 简介
Feign是一个声明式的WebService客户端。它的出现使开发WebService客户端变得很简单。使用Feign只需要创建一个接口加上对应的注解。
Feign 是一种声明式、模板化的HTTP 客户端。在SpringCloud 中使用Feign，可以做到使用HTTP 请求访问远程服务，就像调用本地方法一样的，开发者完全感知不到这是在调用远程方法，更感知不到在访问HTTP 请求</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-03-29
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/学习笔记/">学习笔记</a>
            
              <a href="/blog/categories/学习笔记/SpringCloud/">SpringCloud</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringCloud/">SpringCloud</a>
            
              <a href="/blog/tags/OpenFeign/">OpenFeign</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/03/23/SpringSecurity简单入门/">SpringSecurity简单入门</a>

      <a href="/blog/2020/03/23/SpringSecurity简单入门/" class="index-excerpt">
        
        
          
        
        <div>Spring Security 是什么Spring Security是一套认证授权框架，支持认证模式如HTTP BASIC 认证头 (基于 IETF RFC-based 标准)，HTTP Digest 认证头 ( IETF RFC-based 标准)，Form-based authentication (用于简单的用户界面)，OpenID 认证等，Spring Security使得当前系统可以快速</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-03-23
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringSecurity/">SpringSecurity</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/03/21/笔记-SpringCloud学习08-Ribbon基础/">[笔记]SpringCloud学习08: Ribbon基础</a>

      <a href="/blog/2020/03/21/笔记-SpringCloud学习08-Ribbon基础/" class="index-excerpt">
        
        
          
        
        <div>Ribbon 介绍
Ribbon是Netflix发布的一款用于负载均衡的开源项目，是一个客户端的负载均衡器。

Ribbon会基于某些规则(轮询，随机等)决定要调用的服务链接，并且可以使用Ribbon实现自定义的负载均衡算法。
负载均衡是什么负载均衡(Load Balance)简单来说就是将用户的请求平摊到各个服务器上，从而提高服务的承载能力。
Ribbon 本地负载均衡和Nginx 服务端负载均</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-03-21
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/学习笔记/">学习笔记</a>
            
              <a href="/blog/categories/学习笔记/SpringCloud/">SpringCloud</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringCloud/">SpringCloud</a>
            
              <a href="/blog/tags/Ribbon/">Ribbon</a>
            
          </div>
        
      </div>
    </div>
  </div>

  <div class="row mx-auto index-card">
    
    
    <div class="col-12 col-md-12 mx-auto index-info">
      <a class="index-header" href="/blog/2020/03/20/笔记-SpringCloud学习07-Eureka自我保护/">[笔记]SpringCloud学习07: Eureka自我保护</a>

      <a href="/blog/2020/03/20/笔记-SpringCloud学习07-Eureka自我保护/" class="index-excerpt">
        
        
          
        
        <div>Eureka 自我保护机制保护模式主要用于一组客户端和服务端之间存在网络分区场景下的保护，一旦进入保护模式，Eureka Server会尝试保护其服务注册表中的信息，将不再删除服务注册表中的信息，也就是不会注销任何微服务

一句话概括: 如果某一时刻，Eureka Server中某个微服务不可用了，Eureka不会立即清除，而是会尝试对该微服务的信息进行保存 (CAP中的AP)

为什么需要自我保</div>
      </a>

      <div class="index-btm post-metas">
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-date"></i>&nbsp;2020-03-20
          </div>
        
        
          <div class="post-meta mr-3">
            <i class="iconfont icon-category"></i>
            
              <a href="/blog/categories/学习笔记/">学习笔记</a>
            
              <a href="/blog/categories/学习笔记/SpringCloud/">SpringCloud</a>
            
          </div>
        
        
          <div class="post-meta">
            <i class="iconfont icon-tags"></i>
            
              <a href="/blog/tags/Java/">Java</a>
            
              <a href="/blog/tags/SpringCloud/">SpringCloud</a>
            
              <a href="/blog/tags/Eureka/">Eureka</a>
            
          </div>
        
      </div>
    </div>
  </div>



  <nav aria-label="navigation">
    <span class="pagination" id="pagination">
      <a class="extend prev" rel="prev" href="/blog/"><i class="iconfont icon-arrowleft"></i></a><a class="page-number" href="/blog/">1</a><span class="page-number current">2</span><a class="page-number" href="/blog/page/3/">3</a><a class="page-number" href="/blog/page/4/">4</a><span class="space">&hellip;</span><a class="page-number" href="/blog/page/6/">6</a><a class="extend next" rel="next" href="/blog/page/3/"><i class="iconfont icon-arrowright"></i></a>
    </span>
  </nav>
  
  <script>
    for (ele of document.getElementById("pagination").getElementsByTagName("a")) {
      ele.href += '#board';
    }
  </script>



              </div>
            </div>
          </div>
        </div>
      </div>
    
  </main>

  
    <a id="scroll-top-button" href="#" role="button">
      <i class="iconfont icon-arrowup" aria-hidden="true"></i>
    </a>
  

  
    <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
  

  

  

  <footer class="mt-5">
  <div class="text-center py-3">
    <div>
      <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a>
      <i class="iconfont icon-love"></i>
      <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener">
        <span>Fluid</span></a>
    </div>
    

    

    
  </div>
</footer>

<!-- SCRIPTS -->
<script  src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js" ></script>
<script  src="https://cdn.staticfile.org/twitter-bootstrap/4.4.1/js/bootstrap.min.js" ></script>
<script  src="/blog/js/debouncer.js" ></script>
<script  src="/blog/js/main.js" ></script>

<!-- Plugins -->


  
    <script  src="/blog/js/lazyload.js" ></script>
  



  <script defer src="https://cdn.staticfile.org/clipboard.js/2.0.6/clipboard.min.js" ></script>
  <script  src="/blog/js/clipboard-use.js" ></script>









  <script  src="https://cdn.staticfile.org/typed.js/2.0.11/typed.min.js" ></script>
  <script>
    var typed = new Typed('#subtitle', {
      strings: [
        '  ',
        "一个兴趣使然的个人博客&nbsp;",
      ],
      cursorChar: "_",
      typeSpeed: 70,
      loop: false,
    });
    typed.stop();
    $(document).ready(function () {
      $(".typed-cursor").addClass("h2");
      typed.start();
    });
  </script>





  <script  src="/blog/js/local-search.js" ></script>
  <script>
    var path = "/blog/local-search.xml";
    var inputArea = document.querySelector("#local-search-input");
    inputArea.onclick = function () {
      searchFunc(path, 'local-search-input', 'local-search-result');
      this.onclick = null
    }
  </script>









  
  
    <script type="text/javascript">
      //定义获取词语下标
      var a_idx = 0;
      jQuery(document).ready(function ($) {
        //点击body时触发事件
        $("body").click(function (e) {
          //需要显示的词语
          var a = new Array("富强", "民主", "文明", "和谐", "自由", "平等", "公正", "法治", "爱国", "敬业", "诚信", "友善");
          //设置词语给span标签
          var $i = $("<span/>").text(a[a_idx]);
          //下标等于原来下标+1  余 词语总数
          a_idx = (a_idx + 1) % a.length;
          //获取鼠标指针的位置，分别相对于文档的左和右边缘。
          //获取x和y的指针坐标
          var x = e.pageX, y = e.pageY;
          //在鼠标的指针的位置给$i定义的span标签添加css样式
          $i.css({
            "z-index": 999,
            "top": y - 20,
            "left": x,
            "position": "absolute",
            "font-weight": "bold",
            "color": rand_color()
          });
          // 随机颜色
          function rand_color() {
            return "rgb(" + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + "," + ~~(255 * Math.random()) + ")"
          }
          //在body添加这个标签
          $("body").append($i);
          //animate() 方法执行 CSS 属性集的自定义动画。
          //该方法通过CSS样式将元素从一个状态改变为另一个状态。CSS属性值是逐渐改变的，这样就可以创建动画效果。
          //详情请看http://www.w3school.com.cn/jquery/effect_animate.asp
          $i.animate({
            //将原来的位置向上移动180
            "top": y - 180,
            "opacity": 0
            //1500动画的速度
          }, 1500, function () {
            //时间到了自动删除
            $i.remove();
          });
        });
      })
      ;
    </script>
  














<script src="/blog/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginModelPath":"assets/","model":{"jsonPath":"/blog/live2dw/assets/tororo.model.json"},"display":{"position":"left","width":300,"height":300},"mobile":{"show":false},"log":false,"pluginJsPath":"lib/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
